@echo off

:: copy html
echo Begin copy HTML...
xcopy "..\ruoyi-ui\dist\*" ".\nginx\html\dist" /E /I /Y

:: copy jar files
call :copyJar "..\ruoyi-gateway\target\ruoyi-gateway.jar" ".\ruoyi\gateway\jar"
call :copyJar "..\ruoyi-auth\target\ruoyi-auth.jar" ".\ruoyi\auth\jar"
call :copyJar "..\ruoyi-visual\ruoyi-monitor\target\ruoyi-visual-monitor.jar" ".\ruoyi\visual\monitor\jar"
call :copyJar "..\ruoyi-modules\ruoyi-system\target\ruoyi-modules-system.jar" ".\ruoyi\modules\system\jar"
call :copyJar "..\ruoyi-modules\ruoyi-file\target\ruoyi-modules-file.jar" ".\ruoyi\modules\file\jar"
call :copyJar "..\ruoyi-modules\ruoyi-job\target\ruoyi-modules-job.jar" ".\ruoyi\modules\job\jar"
call :copyJar "..\ruoyi-modules\ruoyi-gen\target\ruoyi-modules-gen.jar" ".\ruoyi\modules\gen\jar"

goto :eof

:copyJar
echo Begin copy %~n1...
if not exist "%~2" (
    mkdir "%~2"
)
copy /Y "%~1" "%~2"
goto :eof